import { createStore } from 'vuex'
import global from './modules/global'
import shopcar from './modules/shopcar'
import cate from './modules/cate'
import user from './modules/user'
import createPersistedstate from 'vuex-persistedstate'
// 创建vuex仓库并导出
export default createStore({
  // 全局模块
  ...global,
  modules: {
    // 局部模板
    user,
    cate,
    shopcar
  },

  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store',
      paths: ['user', 'shopcar']
    })
  ]

})
